{% extends ../base.html %}

{% block body %}

<div class="col-md-12">
<!-- POST会被GET参数覆盖 -->
<form method="GET">
    <input type="text" name="count" class="hide" value="on">
    <table>
        <tr>
            <td>路径</td>
            <td><textarea cols="100" name="path">{{path}}</textarea></td>
        </tr>
        <tr>
            <td>递归</td>
            <td><input type="checkbox" name="recursive" {% if recursive == "on" %} checked {% end %}/></td>
        </tr>
        <tr>
            <td>黑名单</td>
            <td>
                <p style="color: red;">*匹配任意字符，逗号分隔多个匹配项, 比如[*web*, *.html]</p>
                <textarea name="blacklist" cols=100>{{blacklist}}</textarea>
            </td>
        <tr>
            <td>类型</td>
            <td>
                <select name="type">
                    {% for _type in typedict %}
                        <option value="{{_type}}" {% if type == _type %} selected {% end %}>{{_type}}</option>
                    {% end %}
                </select>
            </td>
        </tr>
    </table>
    <button>统计</button>
</form>
</div>

<table>
<tr>
<th>文件名</th>
<th>行数</th>
<th>有效行数</th>
<th>空白行数</th>
<th>查看</th>
</tr>

{% for info in line_infos %}

    <tr>
        <td>{{info.fname}}</td>
        <td>{{info.lines}}</td>
        <td>{{info.validlines}}</td>
        <td>{{info.blanklines}}</td>
        <td><a target="_blank" href="/code/view_source?path={{info.fname}}">查看</a></td>
    </tr>

{% end %}
</table>

{% end %}